<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <img src="../images/hot_2.jpg" alt="">
    <script>
        var img=document.querySelector("img")
        img.onclick=function()
        {
            // console.log(img.src);
            if(img.src.indexOf('hot_2')>=0)
            {
                img.src='../images/hot_3.jpg';
            }else{
                img.src='../images/hot_2.jpg';
            }
           
            img.title='这是nv装产品图片title';
            img.alt='这是女装产品图片alt'
            
        }
    </script>
</body>
</html>